Skip to content

Connect My Computer: Store agent logs#32044

Merged
gzdunek merged 9 commits intomasterfrom
gzdunek/cmc-agent-logging
Sep 21, 2023
Merged

Connect My Computer: Store agent logs#32044
gzdunek merged 9 commits intomasterfrom
gzdunek/cmc-agent-logging

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Sep 18, 2023

Contributes to #27881

Adds storing agent logs to disk.

Teleport has an ability to store logs, but unfortunately it is disabled by default and the only way to enable it (and set a path) is by modyfying the config.yaml file. For now, we are going to take the easier way and just log on the JS side.

Logs are stored in App Data/Teleport Connect/agents/<profile name>/logs/teleport.log.

I also added a menu item to open logs dir and an action to open agent logs dir in the CMC status page.

Best to review commit-by-commit.

@gzdunek gzdunek force-pushed the gzdunek/cmc-agent-logging branch from 1b0f8fd to 33b9492 Compare September 18, 2023 14:35
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding those extra "Open logs" buttons!

Comment thread web/packages/teleterm/src/mainProcess/mainProcess.ts Outdated
Comment thread web/packages/teleterm/src/mainProcess/mainProcess.ts
Comment thread web/packages/teleterm/src/mainProcess/agentRunner/agentRunner.ts Outdated
Comment thread web/packages/teleterm/src/mainProcess/mainProcess.ts
@gzdunek gzdunek requested a review from ravicious September 21, 2023 07:56
@gzdunek gzdunek force-pushed the gzdunek/cmc-agent-logging branch from 043901d to e9e8902 Compare September 21, 2023 08:00
# Conflicts:
#	web/packages/teleterm/src/mainProcess/mainProcess.ts
#	web/packages/teleterm/src/mainProcess/mainProcessClient.ts
#	web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputerStatus/DocumentConnectMyComputerStatus.tsx
@gzdunek gzdunek enabled auto-merge September 21, 2023 14:25
@gzdunek gzdunek added this pull request to the merge queue Sep 21, 2023
Merged via the queue into master with commit d56beee Sep 21, 2023
@gzdunek gzdunek deleted the gzdunek/cmc-agent-logging branch September 21, 2023 14:54
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gzdunek See the table below for backport results.

Branch Result
branch/v14 Create PR

gzdunek added a commit that referenced this pull request Sep 25, 2023
* Add `omitTimestamp` to `FileLoggerOptions`

* Store logs of the agent process

* Kill agent process with SIGQUIT

SIGQUIT is used for a graceful shutdown
https://github.com/gravitational/teleport/blob/1212306cff9be443286cdf0e8cbdf6471fc392d7/lib/service/signals.go#L59

* Add menu item that opens logs directory

* Add an action that opens agent logs directory

* Revert "Kill agent process with SIGQUIT"

This reverts commit 3475be8.

* Change 'Learn More' to 'Open Documentation'

* Add a note to the notification that the logs dir may not exist

(cherry picked from commit d56beee)
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gzdunek See the table below for backport results.

Branch Result
branch/v14 Failed

github-merge-queue Bot pushed a commit that referenced this pull request Sep 25, 2023
* Add `omitTimestamp` to `FileLoggerOptions`

* Store logs of the agent process

* Kill agent process with SIGQUIT

SIGQUIT is used for a graceful shutdown
https://github.com/gravitational/teleport/blob/1212306cff9be443286cdf0e8cbdf6471fc392d7/lib/service/signals.go#L59

* Add menu item that opens logs directory

* Add an action that opens agent logs directory

* Revert "Kill agent process with SIGQUIT"

This reverts commit 3475be8.

* Change 'Learn More' to 'Open Documentation'

* Add a note to the notification that the logs dir may not exist

(cherry picked from commit d56beee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants